#!/bin/bash 
# simple scripts menu
# 
diskspace() {
    clear
    df -k 
}

whoseon() {
    clear
    who
}

menusage() {
    clear
    cat /proc/meminfo
}

menu() {
    clear
    echo -e "\t\tSys Admin Menu\n "
    echo -e "\t1. Display disk space"
    echo -e "\t2. Display logged on users"
    echo -e "\t3. Display memory usage"
    echo -e "\t0. Exit program\n\n"
    echo -en "\t\tEnter option: "
    read -n 1 option
}

while [ 1 ]; do
    menu
    case $option in 
        0)
            break
            ;;
        1)
            diskspace
            ;;
        2)
            whoseon
            ;;
        3)
            menusage
            ;;
        *)
            echo "Sorry, wrong selection"
            ;;
    esac
    echo -en "Press any key to start...or Press Ctrl+C to cancel"
    read -n 1 line
done
clear
